package com.baifc.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * projectName: spring-in-action-web
 * packageName: com.baifc.web
 * Created: 2019/5/23.
 * Auther: baifc
 * Description:
 */
@Controller
public class LoginController {

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public String Login() {
        return "login";
    }

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String Login(@RequestParam String username, @RequestParam String password) {
        System.out.println("username :" + username + "login!");
        return "redirect:home";
    }
}
